package com.cade.agriculturemall.db;

import android.content.Context;
import android.database.DatabaseErrorHandler;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by hshunxin on 2018/2/9.
 */

public class RecordSQLiteOpenHelper extends SQLiteOpenHelper {
    private static String name = "temp.db";
    private static Integer version = 1;
    public final static String T_NAME = "record";
    public final static String TABLE_ID = "_id";
    public final static String TABLE_NAME = "name";
    public RecordSQLiteOpenHelper(Context context) {
        super(context, name, null, version);
    }

    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        String sql = "create table " + T_NAME + " ( "
                + TABLE_ID + " Integer primary key autoincrement ,"
                + TABLE_NAME + " varchar(200)"
                + " ) ";
        sqLiteDatabase.execSQL(sql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }
}
